#获得用户输入
file_name=input('请输入英文文本文件名或者文件路径:')
f=open(file_name,'rt',encoding='utf-8')
txt=f.read()
print("大小写转换以后的文本内容:\n{}".format(str.swapcase(txt)))
##upper_letters=''.join([chr(i) for i in range(65,91)])
##lower_letters=upper_letters.lower()
### 创建文件对象
##with open(file_name,'rt',encoding='utf-8') as read_file:
##    txt=read_file.read()
##    for char in upper_letters:
##        txt=txt.replace(char
##    with open(file_name,'rt',encoding='utf-8') as write_file:
        

##with open(file_name,'rt',encoding='utf-8') as read_f:
##    for line in read_f:
##        new_line=''
##        for char in line:
##            if 'a'<=char<='z':
##                new_line+=str.upper(char)
##            elif 'A'<=char<='Z':
##                new_line+=str.lower(char)
##            
##            new_line+=char
